language: common-lisp
# Sudo is required to install Roswell and some Lisp implementations
sudo: true

env:
  global:
    - PATH=~/.roswell/bin:$PATH
    - CL_SOURCE_REGISTRY="$(pwd)//"
  matrix:
    # Supported implementations
    - LISP=ccl
    - LISP=sbcl

    # Unsupported implementations
    # unable to find libssl.so, I tried hard, but it doesn't see it
    #- LISP=allegro
    # fails with mmap: Invalid argument
    #            ensure_space: Failed to validate 0 bytes at 0x58100000
    #- LISP=cmucl
    # shows error there is no package with name "UIOP"
    #- LISP=clisp
    # it shows success but actually fails with tracebacks
    #- LISP=abcl
    # compile error on loading yaclml-20150709-git
    #- LISP=ecl

os:
  - osx
  - linux

matrix:
  allow_failures:
    - env: LISP=allegro
    - env: LISP=cmucl
    - env: LISP=clisp
    - env: LISP=abcl
    - env: LISP=ecl

addons:
  apt:
    packages:
      - libtidy-dev
      - libc6-i386
      - python-pip
#      - openjdk-7-jre
      
install:
  - curl -L https://raw.githubusercontent.com/snmsts/roswell/master/scripts/install-for-ci.sh | sh

cache:
  directories:
    - $HOME/.roswell
    - $HOME/.config/common-lisp

before_script:
  - env | sort
  - ros --version
  - ros install asdf
  # Version fixed for more build stability
  # TODO: update it from time to time
  - ros install 40ants/qlot/freeze/6fdc1ca4778a905870b6c7bbbd598b3966d53453
  - ros config
  
  # Using latest dissect because current Quicklisp fails on SBCL >= 1.4.10
  # https://github.com/fukamachi/qlot/commit/367f87c89b08afca0ff13a8c3b58d0c9fd6cb567
  - ros install Shinmera/dissect
  - ros install fukamachi/rove
  - ros install 40ants/cl-info

  - rm qlfile.lock # to always check weblocks on latest versions of quicklisp and ultralisp
  - qlot install --no-deps
  - qlot exec ros run -e '(progn (ql:quickload :weblocks-test) (uiop:quit 0))'
  - qlot exec cl-info hamcrest rove dissect weblocks
    
  
script:
  - qlot exec rove weblocks-test.asd
  - qlot exec ./check-quickstart.ros
  - ./build-docs-on-ci.sh

